#!/bin/bash

# txt文件从这个选择了必须的，否则太大 https://kubesphere-installer.pek3b.qingstor.com/offline/v3.0.0/kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz 
#   kubesphere-all-v3.0.0-offline-linux-amd64/kubesphere-images-v3.0.0/images-list-v3.0.0.txt
IMG=$(cat images-list-v3.0.0.txt)

echo $IMG

CMD="docker save "
for image in $IMG; do
    url=${image%%/*}
    ImageName=${image#*/}
    echo $image $url $ImageName

    CMD="${CMD} ${image}"
done

CMD="${CMD} ${image} -o kubesphere3-deps.tar"
echo $CMD
#export docker images
$CMD
